<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8" %>

<%@ page import="com.easyui.common.UserLogin" %>

<%
	String userID = (String)session.getAttribute("userID");
	String role = (String)session.getAttribute("role");
	if(userID == null || role == null) {
		response.sendRedirect("login.html");
	} 
	
%>


<script type="text/javascript" src="js/jquery-easyui-1.3.5/jquery.min.js" charset="UTF-8"></script>
 <script type="text/javascript" src="js/jquery-easyui-1.3.5/jquery.easyui.min.js" charset="UTF-8"></script>
 <link rel="stylesheet" href="js/jquery-easyui-1.3.5/themes/default/easyui.css" type="text/css"></link>
 <link rel="stylesheet" href="js/jquery-easyui-1.3.5/themes/icon.css" type="text/css"></link>
 <link rel="stylesheet" href="css/main.css" type="text/css"></link>
 <script type="text/javascript" src="js/mine.js"></script>
 <script type="text/javascript" src="js/jquery-easyui-1.3.5/locale/easyui-lang-zh_CN.js" charset="UTF-8"></script>

<script type="text/javascript" charset="UTF-8">
	var adminChangeLayout;
	var adminChangeForm;
	$(function(){
		adminChangeLayout = $('adminChangeLayout').layout();
		adminChangeForm = $('#adminChangeForm').form({//easyui表单方式提交可以提交文件类型
						url:'servlet/ChangePswServlet',
						success:function(msg){
							if(msg == 'ok') {
								$.messager.show({
									title:'提示',
									msg:'修改密码成功'
								});
							} else {
								if(msg == 'error_psw') {
									$.messager.alert('提示','原密码错误','error');
								} else {
									$.messager.alert('提示','修改密码失败','error');
								}
							}
						}
		}); 
		
});
		
</script>
 
 <div id="adminChangeLayout" fit="true" border="false" >
		<div region="center"  border="false" style="margin:0 auto;overflow:auto;" noheader="true">
		<fieldset style="height:110px; width:250px;border:1px #09F solid;">
			<form id="adminChangeForm" method="post" style="margin:0 auto;">
				<input type="hidden" name="action" value="changePsw" />
				<input type="hidden" name="role" value="<%= role %>" />
				<input type="hidden" name="userID" value="<%= userID %>" />
				<table>
					<tr>
						<th>旧密码</th>
						<td><input type="password" name="oldPsw" id="oldPsw" class="easyui-validatebox" required="true" /></td>
					</tr>
					<tr>
						<th>新密码</th>
						<td><input type="password" name="newPsw" id="newPsw" class="easyui-validatebox" required="true"/></td>
					</tr>
					<tr>
						<th>确认密码</th>
						<td><input type="password" name="rePsw" id="rePsw" class="easyui-validatebox" required="true" validType="eqPassword['#adminChangeForm input[name=newPsw]']" /></td>
					</tr>
					<tr>
						<td>&nbsp;</td>
						<td align="left">
							<a href="javascript:void(0);" class="easyui-linkbutton"  pain="true" onclick="adminChangeForm.submit();" >确定</a>
						</td>
					</tr>
					
				</table>
			</form>
		</fieldset>
		</div>
</div>
 